package com.zzyweb.managementsystem.util;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author zhiyi
 * @date 9/23/25
 **/
@Component
public class MyMetaDataHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        System.out.println("开始创建填充");
        this.strictInsertFill(metaObject, "createtime",Date.class, new Date());
        this.strictInsertFill(metaObject, "updatetime",Date.class, new Date());
    }



    @Override
    public void updateFill(MetaObject metaObject) {
        this.strictUpdateFill(metaObject, "updatetime",Date.class, new Date());
    }
}
